<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
   input{
         margin:5px;
   }
</style>
<script type="text/javascript">
   function subf(op){
	   f.action='/cal/'+op+'.action';
	   f.submit();
   }
</script>
</head>
<body>
    <form name="f" method="post">
       <h2>简易计算器</h2>
              第一个数<input name="one" type="text" value="${one}"/><br/>
              第二个数<input name="two" type="text" value="${two}"/><br/>
       <input type="button" value="+" onclick="subf('add')">       
       <input type="button" value="-" onclick="subf('minus')">       
       <input type="button" value="*" onclick="subf('times')">       
       <input type="button" value="/" onclick="subf('div')"><br/>        
              结果<input name="res" type="text" readonly value="${result}"/>   
    </form>
</body>
</html>